package com.easywan.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	public static Date getNowDate(){
		return new Date(System.currentTimeMillis());
	}
	@SuppressWarnings("deprecation")
	public static String dateToPath(Date date){
		return date.getYear()+"/"+date.getMonth()+"/"+date.getDate() + "/";
	}
	public static String dateToPath() {
		return dateToPath(getNowDate());
	}
	public static Date StringToDate(String dateString, String string)  {
		SimpleDateFormat sdf = new SimpleDateFormat(string);
		
		try {
			return sdf.parse(dateString);
		} catch (ParseException e) {
			e.printStackTrace();
			return null;
		}
	}
}
